'''
Author: duliang thinktanker@163.com
Date: 2024-03-04 17:15:48
LastEditors: thinktanker thinktanker@163.com
LastEditTime: 2024-03-18 16:58:11
FilePath: \weixin\test.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
import re
import base64

temp = {
    "data": [{
        "BytesExtra":
        "GiQIAhIgM2U0NWUwYTBhNTM5M2FkNWZiY2M0NWZmZTBkM2QxNzIadQgDEnF3eGlkXzE5ODkyNzk4OTE1MTJcRmlsZVN0b3JhZ2VcTXNnQXR0YWNoXDg5ZDZhN2RjYzgwMGNlZTEyNDM1MzA5YmZkZDBhOTEzXFRodW1iXDIwMjQtMDNcMThlNTBjNjAxNzJfMWZhX3RodW1iLmRhdBqAAQgEEnx3eGlkXzE5ODkyNzk4OTE1MTJcRmlsZVN0b3JhZ2VcTXNnQXR0YWNoXDg5ZDZhN2RjYzgwMGNlZTEyNDM1MzA5YmZkZDBhOTEzXEltYWdlXDIwMjQtMDNcOTVhM2JmYTY0MTQ1MzNlZjExZmJiODkxYzUyNDhjY2IuZGF0GlMIBxJPPG1zZ3NvdXJjZT48c2VjX21zZ19ub2RlPjxhbG5vZGU+PGZyPjE8L2ZyPjwvYWxub2RlPjwvc2VjX21zZ19ub2RlPjwvbXNnc291cmNlPg==",
        "BytesTrans": "",
        "CompressContent": "",
        "CreateTime": "1709557330",
        "DisplayContent": "",
        "FlagEx": "0",
        "IsSender": "0",
        "MsgSequence": "863578457",
        "MsgServerSeq": "1",
        "MsgSvrID": "8817156585567823498",
        "Reserved0": "0",
        "Reserved1": "2",
        "Reserved2": "",
        "Reserved3": "",
        "Reserved4": "",
        "Reserved5": "",
        "Reserved6": "",
        "Sequence": "1709557330000",
        "Status": "2",
        "StatusEx": "0",
        "StrContent": "🐷",
        "StrTalker": "wangtao1987512",
        "SubType": "0",
        "TalkerId": "6",
        "Type": "1",
        "localId": "100"
    }],
    "total":
    1,
    "wxid":
    "wxid_1989279891512"
}

if "BytesExtra" in temp["data"][0]:
    temp = (base64.b64decode(temp["data"][0]["BytesExtra"]))
    t = re.findall(rb'FileStorage(.*?).dat', temp)
    print(t[0].decode('utf8'))
